<template>
  <YsRow>
    <div class="photos-title border_style">
      <p class="text_01">
        X射线探伤检测报告（设备级）
      </p>
      <div class="report_code text_01">
        <label>报告编号</label>
        <div class="code_rigth">
          {{ report_code }}
        </div>
      </div>
    </div>
    <div class="info-title">
      设备信息
    </div>
    <div class="photos-table border_style" v-if="data.length >= 8">
      <div class="border_style photos-row" v-for="(item, index) in data.slice(0, 8)" :key="index">
        <div class="photos-col photos-col1 border_style text_01">
          {{ item.field_name }}
        </div>
        <div class="td_ws photos-col photos-col1 text_01">
          <span class="text_01">
            {{ item.value }}
          </span>
        </div>
      </div>
    </div>
    <div class="photos-table column2 border_style" v-if="data.length >= 8">
      <div class="border_style photos-row" v-for="(item, index) in data.slice(8)" :key="index">
        <div class="photos-col photos-col1 border_style text_01">
          {{ item.field_name }}
        </div>
        <div class="photos-col photos-col1 text_01">
          <span class="text_01">
            {{ item.value }}
          </span>
        </div>
      </div>
    </div>
  </YsRow>
</template>
<script>
export default {
  name: 'headerTemplateEqu',
  props: {
    data: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  watch: {
    data: {
      handler(nv) {
        
      }
    }
  },
  data() {
    return {
      report_code: "",// 报告编号
    }
  },
  methods: {
  }
}
</script>
<style scoped lang='less'>
.photos-title {
  height: 100px;
  width: 100%;
  line-height: 80px;
  position: relative;
  p {
    text-align: center;
    font-size: 24px;
    font-family: PingFang SC-Medium, PingFang SC;
    font-weight: 500;
  }
  .report_code {
    position: absolute;
    right: 16px;
    bottom: 0px;
    height: 38px;
    line-height: 38px;
    font-size: 16px;
    display: flex;
    justify-content: center;
    .code_rigth {
      width: 200px;
      margin-left: 10px;
    }
  }
}
.info-title {
  font-weight: 500;
  padding: 10px 0;
  color: #405580;
  font-size: 18px;
  font-family: PingFang SC-Medium, PingFang SC;
}
.photos-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 58px;
  border: 1px solid #e1e6f0;
  border-right: none;
  .photos-row {
    margin-bottom: -1px;
    display: flex;
    border-bottom: 1px solid #cfd7e5;
  }
  .photos-row:nth-child(4n) {
    border-right: none;
  }
  .photos-col {
    width: 50%;
    height: 100%;
    font-size: 16px;
    line-height: 58px;
    padding: 0 16px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .photos-col1 {
    border-right: 1px solid #e1e6f0;
  }
  /deep/ .photos-col2 {
    width: 50%;
  }
}
.column2 {
  grid-template-columns: repeat(2, 1fr);
  border-top: none;
  border-right: none;
}
.td_ws {
  max-width: 350px !important;
}
</style>
